<template>
    <sub-box>
        <breadcrumb :title="'通知详情'"></breadcrumb>
        <div class="notice-content white-block" v-if="detail">
            <p class="title text-center"><b>{{detail.noticeName}}</b></p>
            <p class="time text-center">发布时间：{{detail.noticeStartTime}}</p>
            <div class="content mt30" v-html="detail.noticeContentHtml || detail.noticeContentText"></div>
        </div>
    </sub-box>
</template>

<script>
    import subBox from '../../components/layout/layout-sub'
    import breadcrumb from '../../components/breadcrumb'

    export default {
        data() {
            return {
                id: '',
                detail: null
            }
        },
        mounted() {
            this.id = this.$route.params.id
            if (this.id) this.getDetail()
        },
        methods: {
            getDetail() {
                this.$http.get('/gsNotice/getNoticeById', {
                    noticeId: this.id || ''
                }).then(result => {
                    if (result.success) {
                        this.detail = result.data
                    }
                    this.$method.updateView()
                })
            }
        },
        components: {
            subBox,
            breadcrumb
        }
    }
</script>

<style scoped lang="less">
    .notice-content {
        min-height: 3rem;
        padding: 1.5rem 2rem;
        .title {
            font-size: 0.2rem;
        }
        .time {
            padding-top: 0.28rem;
            color: #999;
            font-size: 0.16rem;
        }
        .content {
            font-size: 0.16rem;
        }
        .content-p {
            padding-top: 0.19rem;
        }
    }
</style>
